Fix some problems with prelighting of icons in entries
authorMatthias Clasen <mclasen@redhat.com>
Mon, 13 Jul 2009 18:48:10 +0000 (14:48 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 13 Jul 2009 18:48:10 +0000 (14:48 -0400)
gtk/gtkentry.c

index f73f19edb26633dc21166ef26940836353233088..153951d455ffbd00b963471b3cb12a111c08980f 100644 (file)
@@ -3555,6 +3555,10 @@ gtk_entry_leave_notify (GtkWidget        *widget,
 
       if (icon_info != NULL && event->window == icon_info->window)
         {
+          /* a grab means that we may never see the button release */
+          if (event->mode == GDK_CROSSING_GRAB || event->mode == GDK_CROSSING_GTK_GRAB)
+            icon_info->pressed = FALSE;
+
           if (should_prelight (entry, i))
             {
               icon_info->prelight = FALSE;
@@ -7991,9 +7995,14 @@ gtk_entry_set_icon_sensitive (GtkEntry             *entry,
     {
       icon_info->insensitive = !sensitive;
 
+      icon_info->pressed = FALSE;
+      icon_info->prelight = FALSE;
+
       if (GTK_WIDGET_REALIZED (GTK_WIDGET (entry)))
         update_cursors (GTK_WIDGET (entry));
 
+      gtk_widget_queue_draw (GTK_WIDGET (entry));
+
       g_object_notify (G_OBJECT (entry),
                        icon_pos == GTK_ENTRY_ICON_PRIMARY ? "primary-icon-sensitive" : "secondary-icon-sensitive");
     }